package com.laowang.project.system.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.laowang.project.system.mapper.UserPointLogMapper;
import com.laowang.project.system.domain.UserPointLog;
import com.laowang.project.system.service.UserPointLogService;

/**
 * 用户积分变动记录Service业务层处理
 *
 * @author laowang
 * @date 2023-01-05
 */
@Service
public class UserPointLogServiceImpl implements UserPointLogService {
    @Autowired
    private UserPointLogMapper userPointLogMapper;

    /**
     * 查询用户积分变动记录
     *
     * @param id 用户积分变动记录ID
     * @return 用户积分变动记录
     */
    @Override
    public UserPointLog selectUserPointLogById(Long id) {
        return userPointLogMapper.selectUserPointLogById(id);
    }

    /**
     * 查询用户积分变动记录列表
     *
     * @param userPointLog 用户积分变动记录
     * @return 用户积分变动记录
     */
    @Override
    public List<UserPointLog> selectUserPointLogList(UserPointLog userPointLog) {
        return userPointLogMapper.selectUserPointLogList(userPointLog);
    }

    /**
     * 新增用户积分变动记录
     *
     * @param userPointLog 用户积分变动记录
     * @return 结果
     */
    @Override
    public int insertUserPointLog(UserPointLog userPointLog) {
        return userPointLogMapper.insertUserPointLog(userPointLog);
    }

    /**
     * 修改用户积分变动记录
     *
     * @param userPointLog 用户积分变动记录
     * @return 结果
     */
    @Override
    public int updateUserPointLog(UserPointLog userPointLog) {
        return userPointLogMapper.updateUserPointLog(userPointLog);
    }

    /**
     * 批量删除用户积分变动记录
     *
     * @param ids 需要删除的用户积分变动记录ID
     * @return 结果
     */
    @Override
    public int deleteUserPointLogByIds(Long[] ids) {
        return userPointLogMapper.deleteUserPointLogByIds(ids);
    }

    /**
     * 删除用户积分变动记录信息
     *
     * @param id 用户积分变动记录ID
     * @return 结果
     */
    @Override
    public int deleteUserPointLogById(Long id) {
        return userPointLogMapper.deleteUserPointLogById(id);
    }

    @Override
    public UserPointLog selectLastOne(Long userId) {
        return userPointLogMapper.selectLastOne(userId);
    }
}
